﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using MvvmFoundation.Wpf;

namespace WpfApplication3
{
    public class MainWindowViewModel:ObservableObject
    {
        private List<string> _namesList;

        public List<string> NamesList
        {
            get { return _namesList; }
            private set
            {
                _namesList = value;
                RaisePropertyChanged("NamesList");
            }
        }

        public MainWindowViewModel()
        {
            ClickThisCommand = new RelayCommand(ClickThisCommandExecute,ClickThisCommandExecuteCanExecute);
        }

        private void ClickThisCommandExecute()
        {
            NamesList=new List<string>{"alpha","beta","gama"};
        }

        private bool ClickThisCommandExecuteCanExecute()
        {
            if (NamesList != null)
            {
                return NamesList.Count < 0;
            }
            return true;
        }

        public ICommand ClickThisCommand { get; private set; }
       
    }
}
